package edu.yngsxy.wkstudy.core.sys.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.wkstudy.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 用户与角色的多对多关联表
 * </p>
 *
 * @author group 2
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@TableName("userrole")
@Accessors(chain = true)
@Schema(description = "用户与角色的多对多关联表")
public class Userrole extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID（外键，关联User）
     */
    @TableField("user_id")
    @Schema(title = "用户ID（外键，关联User）", description = "用户ID（外键，关联User）", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "用户ID（外键，关联User）不能为空")
    private Integer userId;

    /**
     * 角色ID（外键，关联Role）
     */
    @TableField("role_id")
    @Schema(title = "角色ID（外键，关联Role）", description = "角色ID（外键，关联Role）", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "角色ID（外键，关联Role）不能为空")
    private Integer roleId;
}
